#ifndef ENTITY_H
#define ENTITY_H

#include <defs/export.h>
#include <defs/global.h>

#include <QUuid>

namespace Opl
{
	namespace Core
	{

		class CORE_EXPORT Singleton
		{
			public:
				virtual ~Singleton(void);

				static Singleton* instance();
				static void drop();

			private:
				Singleton() {}

				Singleton(const Singleton&);  // hide copy constructor
				Singleton& operator=(const Singleton&);  // hide assign op
				// we leave just the declarations, so the compiler will warn us
				// if we try to use those two functions by accident

				static Singleton* m_Instance;
		};

		template <class T>
		class SingletonT
		{
			public:
				static T& Instance() {
					static T _instance; // create static instance of our class
					return _instance;   // return it
				}

			private:
				SingletonT();	// hide constructor
				virtual ~SingletonT();	// hide destructor
				SingletonT(const SingletonT&);  // hide copy constructor
				SingletonT& operator=(const SingletonT&);  // hide assign op
		};
	}
}

#endif /* ENTITY_H */